/**
 * 
 */
package co.fitstart.tencent.customer.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;

import co.fitstart.entity.user.WechatAccount;

/**
 * @author downpour
 *
 */
@Dao("hibernate")
public interface WechatAccountDao {

    /**
     * 
     * @param openid
     * @return
     */
    @Query("FROM WechatAccount WHERE openid = :openid AND unionid IS NOT NULL")
    public WechatAccount getWechatAccount(@Variable("openid") String openid);
    
    /**
     * 
     * @param unionid
     * @return
     */
    @Query("FROM WechatAccount WHERE unionid = :unionid")
    public WechatAccount getWechatAccountByUnionid(@Variable("unionid") String unionid);
    
    /**
     * 
     * @param unionid
     * @param source
     * @return
     */
//    @Query("FROM WechatOpenid WHERE unionid = :unionid AND source = :source")
//    public WechatOpenid getWechatOpenid(@Variable("unionid") String unionid, @Variable("source") UserSource source);
}
